/*
 * @lc app=leetcode.cn id=11 lang=cpp
 *
 * [11] 盛最多水的容器
 */
#include "0.cpp"
// @lc code=start
class Solution {
public:
    int maxArea(vector<int>& height) {
        int result=0;
        int left=0,right=height.size()-1;
        while(left<right){
            result=max(result,min(height[left],height[right])*(right-left));
            if(height[left]<height[right]) left++;
            else right--;
        }
        return result;
    }
};
// @lc code=end

